Optimal. Leaf size=80 \[ -\frac {\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac {a b \cos ^2(c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3957, 2916, 12,
908} \begin {gather*} -\frac {\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {a b \cos ^2(c+d x)}{d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 908
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^2 \sin ^3(c+d x) \, dx &=\int (-b-a \cos (c+d x))^2 \sin (c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {a^2 (-b+x)^2 \left (a^2-x^2\right )}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a^3 d}\\ &=\frac {\text {Subst}\left (\int \frac {(-b+x)^2 \left (a^2-x^2\right )}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=\frac {\text {Subst}\left (\int \left (a^2 \left (1-\frac {b^2}{a^2}\right )+\frac {a^2 b^2}{x^2}-\frac {2 a^2 b}{x}+2 b x-x^2\right ) \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=-\frac {\left (a^2-b^2\right ) \cos (c+d x)}{d}+\frac {a b \cos ^2(c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 72, normalized size = 0.90 \begin {gather*} \frac {\left (-9 a^2+12 b^2\right ) \cos (c+d x)+6 a b \cos (2 (c+d x))+a^2 \cos (3 (c+d x))-24 a b \log (\cos (c+d x))+12 b^2 \sec (c+d x)}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 90, normalized size = 1.12
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+2 b a \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{2} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}}{d}\) | \(90\) |
default | \(\frac {b^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+2 b a \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{2} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}}{d}\) | \(90\) |
norman | \(\frac {\frac {4 a^{2}-12 b^{2}}{3 d}-\frac {4 \left (a^{2}+b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 b a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (4 a^{2}+6 b a -12 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {2 b a \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(181\) |
risch | \(2 i a b x +\frac {b a \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 d}-\frac {3 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {{\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 d}-\frac {3 a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}+\frac {b a \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}+\frac {4 i b a c}{d}+\frac {2 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 b a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}+\frac {a^{2} \cos \left (3 d x +3 c \right )}{12 d}\) | \(183\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 71, normalized size = 0.89 \begin {gather*} \frac {a^{2} \cos \left (d x + c\right )^{3} + 3 \, a b \cos \left (d x + c\right )^{2} - 6 \, a b \log \left (\cos \left (d x + c\right )\right ) - 3 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) + \frac {3 \, b^{2}}{\cos \left (d x + c\right )}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.82, size = 92, normalized size = 1.15 \begin {gather*} \frac {2 \, a^{2} \cos \left (d x + c\right )^{4} + 6 \, a b \cos \left (d x + c\right )^{3} - 12 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - 3 \, a b \cos \left (d x + c\right ) - 6 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 6 \, b^{2}}{6 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \sin ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 100, normalized size = 1.25 \begin {gather*} -\frac {2 \, a b \log \left (\frac {{\left | \cos \left (d x + c\right ) \right |}}{{\left | d \right |}}\right )}{d} + \frac {b^{2}}{d \cos \left (d x + c\right )} + \frac {a^{2} d^{5} \cos \left (d x + c\right )^{3} + 3 \, a b d^{5} \cos \left (d x + c\right )^{2} - 3 \, a^{2} d^{5} \cos \left (d x + c\right ) + 3 \, b^{2} d^{5} \cos \left (d x + c\right )}{3 \, d^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.92, size = 69, normalized size = 0.86 \begin {gather*} \frac {\frac {a^2\,{\cos \left (c+d\,x\right )}^3}{3}-\cos \left (c+d\,x\right )\,\left (a^2-b^2\right )+\frac {b^2}{\cos \left (c+d\,x\right )}+a\,b\,{\cos \left (c+d\,x\right )}^2-2\,a\,b\,\ln \left (\cos \left (c+d\,x\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________